//
//  ColorLightDarkController.m
//  TEXT
//
//  Created by liubo on 2023/7/24.
//  Copyright © 2023 刘博. All rights reserved.
//

#import "ColorLightDarkController.h"

@interface ColorLightDarkController ()

@end

@implementation ColorLightDarkController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (BOOL)isLighterColor:(UIColor *)color {
    const CGFloat* components = CGColorGetComponents(color.CGColor);
    return (components[0]+components[1]+components[2])/3 >= 0.5;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
